home *** CD-ROM | disk | FTP | other *** search
/ Aminet 30 / Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso / Aminet / dev / c / EGCSWOSAlib.lha / src.lha / HotKey.c < prev    next >
C/C++ Source or Header  |  1998-08-02  |  451b  |  19 lines

  1. #include <libraries/commodities.h>
  2. #include <proto/commodities.h>
  3.  
  4. CxObj *HotKey(STRPTR description, struct MsgPort *port, long id)
  5. {
  6.   CxObj *filter;
  7.  
  8.   if ((filter=CreateCxObj(CX_FILTER,(long)description,NULL)))
  9.   {
  10.     AttachCxObj(filter, CreateCxObj(CX_SEND, (long)port, id));
  11.     AttachCxObj(filter, CreateCxObj(CX_TRANSLATE, NULL, NULL));
  12.     if (CxObjError(filter))
  13.     {
  14.       DeleteCxObjAll(filter); filter=NULL;
  15.     }
  16.   }
  17.   return filter;
  18. }
  19.